package com.zhanghe.mall.service.configuration;

import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
import javax.persistence.EntityManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;

@Configuration
public class QueryDslConfig {

  @Autowired
  private EntityManager entityManager;

  @Bean
  public JPAQueryFactory getJPAQueryFactory(){
    return new JPAQueryFactory(entityManager);
  }


}
